<template>
    <div class="renting">
        <header class="header"> <span @click="goBack"> ＜ </span><span>我想买个房</span><span></span></header>
        <main class="main">
            <div class="massage">
                <span></span>
                <span>发布本条信息将收费10.00元</span>
            </div>
            <div class="select3">
                <div>
                    <p>小区</p>
                    <div class="section">请选择小区</div>
                </div>
                <div>
                    <p>房产类型</p>
                    <view class="section">
                        <picker @change="bindPickerChange" :value="index" :range="array">
                            <view class="picker">
                            {{array[index]}}
                            </view>
                        </picker>
                    </view>
                </div>
                <div>
                    <p>区域</p>
                    <view class="section">
                        <picker @change="bindPickerChange2" :value="index2" :range="array2">
                            <view class="picker">
                            {{array2[index2]}}
                            </view>
                        </picker>
                    </view>
                </div>
            </div>
            <div class="select3">
                <div>
                    <p>面积</p>
                    <input type="text"  v-model="values1"
                    placeholder="请输入" placeholder-class="placeholder-class" >
                </div>
                <div>
                    <p>求购预算</p>
                    <input type="text"  v-model="values2"
                    placeholder="请输入" placeholder-class="placeholder-class">
                </div>
            </div>
            <div class="select3">
                <div>
                    <p>标题</p>
                    <input type="text"  v-model="values3"
                    placeholder="请输入" placeholder-class="placeholder-class">
                </div>
                <div>
                    <p>描述</p>
                    <input type="text"  v-model="values4"
                    placeholder="请输入" placeholder-class="placeholder-class">
                </div>
            </div>
            <div class="select3">
                <div>
                    <p>联系人</p>
                    <input type="text"  v-model="values5"
                    placeholder="请输入" placeholder-class="placeholder-class">
                </div>
            </div>
            <div class="time">
			    <div>
                    <p>有效时间</p>
                    <div :class="flag?'active':''" @click="day">
                        30天
                    </div>
                </div>
            </div>
            <div class="submit">
                <div class="checkbox">
                    <checkbox checked="true"/><span>已阅读并接受</span><span class="sum">《宏烨找房网房源信息发布规则》</span>
                </div>
                <div class="finish">
                    <div @click="btnfu">发布并支付</div>
                </div>
            </div>
        </main>
    </div>
</template>

<script>
import './index.scss'
export default {
    name: 'Renting',

    data() {
        return {
            array:['请选择','高层住宅','小高层住宅','商铺/门面房','厂房','写字楼'],
            array2:['请选择','主城区','宿豫区','宿城新区','苏宿园区','开发区','湖滨新区'],
            index:0,
            index2:0,
            values1:'',
            values2:'',
            values3:'',
            values4:'',
            values5:'',
            flag:false,
        };
    },

    mounted() {
        
    },

    methods: {
        bindPickerChange: function(e) {
            // console.log('picker发送选择改变，携带值为', e.detail.value)
            this.index = e.detail.value
        },
        bindPickerChange2: function(e) {
            // console.log('picker发送选择改变，携带值为', e.detail.value)
            this.index2 = e.detail.value
        },
        goBack:function(){
            wx.switchTab({
                url:'/pages/publish/index'
            })
        },
        day(){
            this.flag=!this.flag
        },
        btnfu(){
            console.log(this.array[this.index])
            console.log(this.array2[this.index2])
            console.log(this.values1)
            console.log(this.values2)
            console.log(this.values3)
            console.log(this.values4)
            console.log(this.values5)
            console.log(this.flag)
        }
    },
};
</script>